/*

I/flutter (12153): │ 🐛         "id": "1877189728600588288",
I/flutter (12153): │ 🐛         "parentId": "1877187258793066496",
I/flutter (12153): │ 🐛         "name": "删除",
I/flutter (12153): │ 🐛         "type": 2,
I/flutter (12153): │ 🐛         "perms": "content:customerInfo:conference:delete",
I/flutter (12153): │ 🐛         "router": null,
I/flutter (12153): │ 🐛         "viewPath": null,
I/flutter (12153): │ 🐛         "enable": true,
I/flutter (12153): │ 🐛         "icon": null,
I/flutter (12153): │ 🐛         "orderNum": 1,
I/flutter (12153): │ 🐛         "isShow": false,
I/flutter (12153): │ 🐛         "keepAlive": true,
*/

/// 分页
class PermsMenu {
  final List<String>? perms;
  final List<PMenu>? menus;

  PermsMenu({this.perms, this.menus});

  /// factory
  factory PermsMenu.fromJson(Map<String, dynamic> json) {
    List<String> perms = [];
    List<PMenu> menus = [];
    if (json['perms'] != null) {
      for (var item in json['perms']) {
        perms.add(item);
      }
    }
    if (json['menus'] != null) {
      for (var item in json['menus']) {
        menus.add(PMenu.fromJson(item));
      }
    }
    return PermsMenu(perms: perms, menus: menus);
  }
}

class PMenu {
  final String? id;
  final String? parentId;
  final String? name;
  final int? type;
  final String? perms;
  final String? router;
  final String? viewPath;
  final bool? enable;
  final String? icon;
  final int? orderNum;
  final bool? isShow;
  final bool? keepAlive;

  PMenu({
    this.id,
    this.parentId,
    this.name,
    this.type,
    this.perms,
    this.router,
    this.viewPath,
    this.enable,
    this.icon,
    this.orderNum,
    this.isShow,
    this.keepAlive,
  });

  /// factory
  PMenu.fromJson(Map<String, dynamic> json)
      : id = json['id'],
        parentId = json['parentId'],
        name = json['name'],
        type = json['type'],
        perms = json['perms'],
        router = json['router'],
        viewPath = json['viewPath'],
        enable = json['enable'],
        icon = json['icon'],
        orderNum = json['orderNum'],
        isShow = json['isShow'],
        keepAlive = json['keepAlive'];
}
